import { defineStore } from 'pinia'
import { CACHE_KEY, useCache} from '@/hooks/web/useCache'
const { wsCache } = useCache()

interface GuestVO {
  guestStatus: string
}
export const useGuestStore = defineStore('guest-store', {
  state: (): GuestVO => ({
    guestStatus: ''
  }),
  getters: {
    getGuestStatus():string{
      if(this.guestStatus == ''){
        this.guestStatus = wsCache.get(CACHE_KEY.GUEST_STATUS)
      }
      return this.guestStatus;
    }
  },
  actions: {
    setGuestStatus(status){
      this.guestStatus = status
      wsCache.set(CACHE_KEY.GUEST_STATUS,status)
    }
  }
})
